package com.example.mrzhou.lvmm.presenter.surround;

import com.example.mrzhou.lvmm.entity.surround.scenic.Scenic;
import com.example.mrzhou.lvmm.model.ModelFactory;
import com.example.mrzhou.lvmm.view.impl.surround.ScenicView;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Mr.zhou on 2016/10/27.
 */

public class ScenicPresenter {

    private ScenicView scenicView;

    public ScenicPresenter(ScenicView scenicView) {
        this.scenicView = scenicView;
    }

    public void getScenicData(Map<String, String> map) {

        ModelFactory.getISurModel().getScenicData(map, new Subscriber<Scenic>() {
            @Override
            public void onCompleted() {
                scenicView.onFinsh();
            }

            @Override
            public void onError(Throwable e) {
                scenicView.onFaiure(e);
            }

            @Override
            public void onNext(Scenic scenic) {
                scenicView.onSuccess(scenic);
            }
        });
    }

}
